package com.p2p.controller.operationsManagement;

import com.p2p.common.base.RespResult;
import com.p2p.entity.InviteStrategy;
import com.p2p.service.operationsManagementService.InviteStrategyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/inviteStrategy")
public class InviteStrategyController {

    @Autowired
    private InviteStrategyService inviteStrategyService;

    /**
     * 邀请活动策略展示
     * @return
     */
    @GetMapping(value = "/findInviteStrategyList")
    @ResponseBody
    public RespResult findInviteStrategyList(){
        return inviteStrategyService.findInviteStrategyList();
    }

    /**
     * 根据id修改邀请策略
     * @param inviteStrategy
     * @return
     */
    @PostMapping(value = "/updateInviteStrategy")
    @ResponseBody
    public RespResult updateInviteStrategy(@RequestBody InviteStrategy inviteStrategy){
        return inviteStrategyService.updateInviteStrategy(inviteStrategy);
    }

}
